/**
 * 运行时环境变量封装
 */

type ENV = 'dev' | 'pro' | 'stg' // stg是测试环境

const env = document.documentElement.dataset.env as ENV || 'dev'

const config = {
  dev: {
    baseApi: 'http://api-driver.marsview.cc/api',
    uploadApi: 'http://api-driver-dev.marsview.cc',
    cdn: 'http://www.aliyun.com',
    mock: false,
    mockApi: '/mock/api'
  },
  pro: {
    baseApi: '/api',
    uploadApi: 'http://api-driver.marsview.cc',
    cdn: 'http://www.aliyun.com',
    mock: false,
    mockApi: '/mock/api'
  },
  stg: {
    baseApi: '/api',
    uploadApi: 'http://api-driver-stg.marsview.cc',
    cdn: 'http://www.aliyun.com',
    mock: false,
    mockApi: '/mock/api'
  },
}

export default {
  env,
  ...config[env]
}